package sl.com.sl.data;

/*    */ import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultHighlighter;
import javax.swing.text.html.HTMLEditorKit;

import sl.com.sl.StripesImageDialog;
import ar.com.visualAORE.util.ReaderWriter;
/*    */ 
/*    */ public class MainTest {
/*    */   //public static final String HTML_TEXt = "<html><body><h1>Heading text to be tested</h1><p>The first paragraph with text.</p><p>The second paragraph with text.</p><table border='1'><tr><td>Cell 1:1</td><td>Cell 1:2</td></tr><tr><td>Cell 2:1</td><td>Cell 2:2</td></tr></table><p>Content with control <input value='main'> text selection.</p></body></html>";
/*    */   public static String HTML_TEXt= ReaderWriter.readFile("/home/julian/pruebaTesis/Backups-with-Rsync.htm");
	//public static String HTML_TEXt= ReaderWriter.readFile("/home/julian/pruebaTesis/borrar.html");
	
	JFrame frame;
/*    */   JEditorPane edit;
/*    */   CSExchange data;
/*    */ 	private static String dumy = ReaderWriter.readFile("/home/julian/pruebaTesis/Backups-with-Rsync.htm");
	//private static String dumy = ReaderWriter.readFile("/home/julian/firmaUADE.html");

/*    */ 
/*    */   public MainTest()
/*    */   {
/* 31 */     this.frame = new JFrame("Text to colored stripes demo");
/* 32 */     this.frame.setDefaultCloseOperation(3);
/*    */ 
/* 34 */     this.edit = new JEditorPane();
/* 35 */     this.frame.getContentPane().add(new JScrollPane(this.edit));
/*    */ 
/* 37 */     final JToolBar tb = new JToolBar();
/* 38 */     JButton b = new JButton("Show Image");
/* 39 */     b.addActionListener(new ActionListener() {
/*    */       public void actionPerformed(ActionEvent e) {
				//MainTest main = new MainTest();
				//main.showImageDialog(tb);
/* 41 */        MainTest.this.showImageDialog(tb);
/*    */       }
/*    */     });
/* 44 */     tb.add(b);
/*    */ 
/* 46 */     this.frame.getContentPane().add(tb, "North");
/* 48 */     dummyInit(dumy);
/* 49 */     this.data = new CSExchangeImpl(this.edit);
/*    */ 
/* 51 */     this.frame.setSize(500, 450);
/* 52 */     this.frame.setLocationRelativeTo(null);
/* 53 */     this.frame.setVisible(true);
/*    */   }
/*    */ 
/*    */   private void showImageDialog(JToolBar tb) {
/* 57 */     StripesImageDialog dlg = new StripesImageDialog(new JFrame(), this.data);
/* 58 */     dlg.setLocation(this.frame.getX() + this.frame.getWidth(), this.frame.getY() + tb.getHeight());
/* 59 */     dlg.setVisible(true);
/*    */   }
/*    */ 
/*    */   public void dummyInit(String dumy) {
/* 63 */     this.edit.setEditorKit(new HTMLEditorKit());
////Handle open button action.
			//HTML_TEXt = ReaderWriter.readFile("/home/julian/pruebaTesis/DNS-HOWTO.html");
/* 64 */    // this.edit.setText("<html><body><h1>Heading text to be tested</h2><p><h1>The first paragraph with text.</h1></p><p>The second paragraph with text.</p><table border='1'><tr><td>Cell 1:1</td><td>Cell 1:2</td></tr><tr><td>Cell 2:1</td><td>Cell 2:2</td></tr></table><p>Content with control <input value='main'> text selection.</p></body></html>");
/*    */    //this.edit.setText(ReaderWriter.readFile("/home/julian/pruebaTesis/DNS-LinuxMagazine.html")); 
		//	this.edit.setText(dumy);
			this.edit.setText(HTML_TEXt);
			try
/*    */     {
/* 67 */       this.edit.getHighlighter().addHighlight(3, 9, new DefaultHighlighter.DefaultHighlightPainter(Color.cyan));
/* 68 */       this.edit.getHighlighter().addHighlight(18, 27, new DefaultHighlighter.DefaultHighlightPainter(Color.red));
/* 69 */       this.edit.getHighlighter().addHighlight(45, 72, new DefaultHighlighter.DefaultHighlightPainter(Color.green));
/* 70 */       this.edit.getHighlighter().addHighlight(100, 120, new DefaultHighlighter.DefaultHighlightPainter(Color.yellow));
/* 71 */       this.edit.getHighlighter().addHighlight(145, 160, new DefaultHighlighter.DefaultHighlightPainter(Color.lightGray));
				this.edit.getHighlighter().addHighlight(300, 500, new DefaultHighlighter.DefaultHighlightPainter(Color.lightGray));
/*    */     } catch (BadLocationException e) {
/* 73 */       e.printStackTrace();
/*    */     }
/*    */   }
/*    */ 
/*    */   public static void main(String[] args) {
/* 78 */     new MainTest();
/*    */   }
/*    */ }

/* Location:           /home/julian/Documents/Demo/
 * Qualified Name:     MainTest
 * JD-Core Version:    0.6.0
 */